//index.js
var qcloud = require('../../vendor/wafer2-client-sdk/index')
var config = require('../../config')
const myApp = getApp();
const window_width = wx.getSystemInfoSync().windowWidth;

Page({
    data: {
      "swiper_banner":[],
      "swiper_banner_height":0,
      "link_list":[],
      "banner_list":[]
    },
    onLoad(){
      const self = this;
      wx.request({
        url: config.service.indexDataUrl,
        header: {
          'content-type': 'application/json' // 默认值
        },
        success(res) {
          self.setData({
            "swiper_banner": res.data.swiper,
            "link_list": res.data.linkList,
            "banner_list": res.data.bannerList
          })
          const h = Math.floor(window_width / 1135 * 500);
          self.setData({
            "swiper_banner_height": h
          })
        }
      })
    }
})
